package com.shopyourstyle.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import com.shopyourstyle.R;

public class MainActivity extends Activity {
	
	private String MSG_TAG = "MainActivity";
	private Button newThemeBtn = null;
	private Button enterThemeBtn = null;
	private Button browseOthersBtn = null;
	private Button editCharacterBtn = null;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Log.d(MSG_TAG, "OnCreate()");
        getView();
        setListener();
    }
    
    private void getView() {
    	newThemeBtn = (Button)findViewById(R.id.main_new_theme);
    	enterThemeBtn = (Button)findViewById(R.id.main_enter_theme);
    	browseOthersBtn = (Button)findViewById(R.id.main_enter_others);
    	editCharacterBtn = (Button)findViewById(R.id.main_edit_character);
    }

	private void setListener() {
		newThemeBtn.setOnClickListener(newThemeBtnLs);
		enterThemeBtn.setOnClickListener(enterThemeBtnLs);
		browseOthersBtn.setOnClickListener(browseOthersBtnLs);
		editCharacterBtn.setOnClickListener(editCharacterBtnLs);
	}
	
	private Button.OnClickListener newThemeBtnLs=new Button.OnClickListener(){
		@Override
		public void onClick(View v) {
			Intent intent = new Intent();
			intent.setClass(MainActivity.this,CreateThemeActivity.class);
			startActivity(intent);
		}
	};
	
	private Button.OnClickListener enterThemeBtnLs=new Button.OnClickListener(){
		@Override
		public void onClick(View v) {
			Intent intent = new Intent();
//			TODO
			intent.setClass(MainActivity.this,ThemesPage.class);
			startActivity(intent);
		}
	};
	
	private Button.OnClickListener browseOthersBtnLs=new Button.OnClickListener(){
		@Override
		public void onClick(View v) {
			Intent intent = new Intent();
			intent.setClass(MainActivity.this,ThemesPage.class);
			startActivity(intent);
		}
	};
	
	private Button.OnClickListener editCharacterBtnLs=new Button.OnClickListener(){
		@Override
		public void onClick(View v) {
			Intent intent = new Intent();
			intent.setClass(MainActivity.this,CharacterActivity.class);
			startActivity(intent);
		}
	};
}